﻿using System;
using System.Collections.Generic;
using System.Text;
using HotelManagement.Common;
using HotelManagement.DL.DAO;

namespace HotelManagement.BL
{
    public class UserBL
    {
        public int Search(ref User user)
        {
            int nResult = (int)ReturnType.FAILED;
            try
            {
                UserDL userDL = new UserDL();
                nResult = userDL.Search(ref user);
            }
            catch
            {
                throw;
            }

            return nResult;
        }

        public int UpdateUser(User user)
        {
            int nResult = (int)ReturnType.FAILED;
            try
            {
                UserDL userDL = new UserDL();
                nResult = userDL.UpdateUser(user);
            }
            catch
            {
                throw;
            }

            return nResult;
        }

        public int AddUser(User user)
        {
            int nResult = (int)ReturnType.FAILED;
            try
            {
                UserDL userDL = new UserDL();
                nResult = userDL.AddUser(user);
            }
            catch
            {
                throw;
            }

            return nResult;
        }

        public int DeleteUser(User user)
        {
            int nResult = (int)ReturnType.FAILED;
            try
            {
                UserDL userDL = new UserDL();
                nResult = userDL.DeletUser(user);
            }
            catch
            {
                throw;
            }

            return nResult;
        }
    }
}
